package com.kashow.bean.teacher.homeworklist;

import com.kashow.bean.BaseBean;

/**
 * Created by cg on 17/1/4.
 */

public class HomeworkListBean extends BaseBean implements Comparable{



    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof HomeworkListBean)) return false;

        HomeworkListBean that = (HomeworkListBean) o;

        if (get_id() != that.get_id()) return false;
        if (getAnswersCount() != that.getAnswersCount()) return false;
        if (!getTitle().equals(that.getTitle())) return false;
        if (!getCreatedAt().equals(that.getCreatedAt())) return false;
        return getId().equals(that.getId());

    }

    @Override
    public int hashCode() {
        int result = get_id();
        result = 31 * result + getTitle().hashCode();
        result = 31 * result + getCreatedAt().hashCode();
        result = 31 * result + getId().hashCode();
        result = 31 * result + getAnswersCount();
        return result;
    }

    /**
     * _id : 1
     * title : 这是一个很难的问题
     * createdAt : 2017-02-14 15:41:39
     * id : 1
     * answersCount : 0
     */

    private int _id;
    private String title;
    private String createdAt;
    private String id;
    private int answersCount;

    public void set_id(int _id) {
        this._id = _id;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public void setCreatedAt(String createdAt) {
        this.createdAt = createdAt;
    }

    public void setId(String id) {
        this.id = id;
    }

    public void setAnswersCount(int answersCount) {
        this.answersCount = answersCount;
    }

    public int get_id() {
        return _id;
    }

    public String getTitle() {
        return title;
    }

    public String getCreatedAt() {
        return createdAt;
    }

    public String getId() {
        return id;
    }

    public int getAnswersCount() {
        return answersCount;
    }

    @Override
    public int compareTo(Object o) {
        return ((HomeworkListBean)o)._id - this._id;
    }
}
